#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <tstruct.h>
struct NoteT {
    QString name;
    QString content;
    QString backGroundColor;
    QString fontColor;
    QString priority;
    QString site;

    // 将 NoteT 转换为 QJsonObject
    QJsonObject toJsonObject() const {
        QJsonObject obj;
        obj["name"] = name;
        obj["content"] = content;
        obj["backGroundColor"] = backGroundColor;
        obj["fontColor"] = fontColor;
        obj["priority"] = priority;
        obj["site"] = site;
        return obj;
    }

    // 从 QJsonObject 转换回 NoteT
    static NoteT fromJsonObject(const QJsonObject &obj) {
        NoteT note;
        note.name = obj["name"].toString();
        note.content = obj["content"].toString();
        note.backGroundColor = obj["backGroundColor"].toString();
        note.fontColor = obj["fontColor"].toString();
        note.priority = obj["priority"].toString();
        note.site = obj["site"].toString();
        return note;
    }
};

QT_BEGIN_NAMESPACE
namespace Ui {
class MainWindow;
}
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();


private:
    Ui::MainWindow *ui;
};
#endif // MAINWINDOW_H
